//
//  IMIBaseAppDelegate.m
//  IMIBase
//
//  Created by Travis on 09-8-11.
//  Copyright Exmart 2009. All rights reserved.
//

#import "AppDelegate.h"
#import "IMIBase/IMIBase.h"

@implementation AppDelegate

@synthesize window;


- (void)applicationDidFinishLaunching:(UIApplication *)application {   

	window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
	window.backgroundColor = [UIColor whiteColor];
	window.multipleTouchEnabled=YES;
    [window makeKeyAndVisible];
	
	[self addEventListener:self forKey:@"showresult" withFunction:@selector(showTestResult:)];
	[self dispatchEvent:[NSEvent eventWithKey:@"showresult" withObject:@"mwm"]];
	
	
}
- (void)showTestResult:(NSEvent*)event{
	
	 //test IMIBase
	 IMILog(AppDir);
	 IMILog(DocDir);
	 IMILog([NSString stringWithUUID]);
	 IMILog([AppDir MD5]);
	 IMILog([AppDir encodeToBase64]);
	 IMILog([AppSetting description]);
	 IMIDevLog(@"%f",[UIDevice availableMemory]);
	 IMILog(event.name);
	 IMILog(event.object);
	 IMILog([self className]);
	 IMILog([NSString className]);
	 
	 
	 
	 UIImageView *imgv=[[UIImageView alloc] initWithImage:[UIDevice screenShot]];
	 imgv.frame=CGRectMake(0, 0, 200, 300);
	 window.backgroundColor=[UIColor grayColor];
	 [window addSubview:imgv];
	 
	 IMILog([NSString MD5OfFile:ResourceFilePath(@"info.plist", nil)]);
	 
	MARK;
	
	[UIApplication showVersion];
	[UIApplication showVersion];
	[UIApplication showVersion];
	[UIApplication showVersion];
	[UIApplication showVersion];
}


- (void)dealloc {
    [window release];
    [super dealloc];
}


@end
